﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using ECCIT.Business.Model;
using OgilvyOne.BLL;
using OgilvyOne.UKNow.BLL;

public partial class admin_infomation_info_preview : AdminBasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string columnID = Request.Params["cid"];
            
            string html = null;
            if (string.IsNullOrEmpty(columnID))
            {
                string aid = Request.Params["aid"];
                CmsVo vo = new CmsVo();
                vo.Aid = int.Parse(aid);
                vo.Preview = 1;
                html = OgilvyOne.BLL.CmsProxy.GetHtml(vo);
            }
            else
            {
                string langID = Request.Params["langID"];
                string id = Request.Params["id"];
                IGenerateHtml bll = GenerateHtmlFactory.CreateInstance(int.Parse(columnID), int.Parse(langID));
                if (bll != null)
                {
                    BaseModel model = bll.GetModelByID(int.Parse(id));
                    html = bll.GetHtml(model);
                }
            }
            Response.Write(html);
            return;
        }
    }
}
